import VueRouter from "vue-router";

import Vue from "vue";


const Home = ()=>import("@/pages/Home")
const Login = ()=>import("@/pages/Login")
const Music = ()=>import("@/pages/Home/Music")

Vue.use(VueRouter)

export default new VueRouter({
    routes:[
        {
            path:"/home",
            component:Home,
            name:'Home',
            children:[
                {
                    path:"music/:id",
                    component:Music,
                    name:"Music",
                    props(routes){
                        return {...routes.query,...routes.params}
                    }
                }
            ]
        },
        {
            path:"/login",
            component:Login,
            name:'Login'
        },
        {
            path:'/',
            redirect:"/home"
        },
        {
            path:'*',
            redirect:"/home"
        }
    ]
})